{include file=$header_start}
{strip} 
<script type="text/javascript" src="{$siteroot}/includes/js/admin/checkall.js" /></script> 
<script type="text/javascript" language="javascript" src="{$siteroot}/includes/js/datepicker/jquery-1.5.1.js"></script> 
<script type="text/javascript" language="javascript" src="{$siteroot}/includes/js/datepicker/jquery.ui.core.js"></script> 
<script type="text/javascript" language="javascript" src="{$siteroot}/includes/js/datepicker/jquery.ui.widget.js"></script> 
<script type="text/javascript" language="javascript" src="{$siteroot}/includes/js/datepicker/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="{$siteroot}/includes/js/datepicker/themes/base/jquery.ui.all.css">
<link rel="stylesheet" type="text/css" href="{$siteroot}/templates/default/style/dashboard.css">
{/strip}
{include file=$header_end}
{literal} 
<script type="text/javascript">
$(function(){
$(".someClass").tipTip();
});

$(function(){
$(".someClass").tipTip({maxWidth: "auto", edgeOffset: 10});
});
</script> 
<script type="text/javascript" language="javascript">
	$.noConflict();
	jQuery(document).ready(function($) {
		$( ".datepicker" ).datepicker({ minDate: "-50year", maxDate: "today",  changeMonth:"true", changeYear:"true", dateFormat:"yy-mm-dd", 
		  onClose: function() {
			this.focus();this.blur() 
		  }
		});
		$('.success_msg').fadeOut(6000);
	});
</script> 
<script type="text/javascript" language="javascript">
function searchOrder()
{
	var paymentfor = $('#paymentfor').val();
	var fromDate = $('#from_date').val();
	var toDate = $('#to_date').val();
	var user_id = $('#user_id').val();
	//if(searchField != '' && searchField != 'Search Order'){
		//alert(searchField);
		if(fromDate!='' && fromDate!='From Date' && toDate!='' && toDate!='To Date'){
			window.location = SITEROOT+'/admin/home.php?q=paymenthisdetail&id='+user_id+'&paymentfor='+paymentfor+'&from_date='+fromDate+'&to_date='+toDate;
		} else {
			window.location = SITEROOT+'/admin/home.php?q=paymenthisdetail&id='+user_id+'&paymentfor='+paymentfor;
		}
		
	//}
}
</script> 
{/literal}
<div class="contain"> {include file=$left_menu}
  <div class="right_contain">
    <div class="heading_box">{$userDetArray.first_name|ucfirst}&nbsp;{$userDetArray.last_name|ucfirst}&nbsp;&raquo;Payment History Details<a href="javascript:;" class="someClass" title="{$moduelArray.module_help_text}" style="float:right;"><img src="{$siteroot}/templates/admin/img/topic_icon6.png" /></a></div>
    <div class="whitebox"> 
      <!--Message Div Start--> 
      {if $msg}
      <div class="masg_div"> {$msg} </div>
      {/if} 
      <!--Message Div End-->
      <div> 
        <!--Form Contain start-->
        <div class="table_viewbox"> 
          <!--<h2>Table Design</h2>-->
          
          <table width="100%" border="0" cellpadding="3" cellspacing="5">
            <tr>
              <td align="right"><select class="input41_selet"  name="paymentfor" id="paymentfor">
                  <option value="0">Select Payment For</option>
                  <option value="membershipplan" {if $smarty.get.paymentfor eq 'membershipplan'} selected="selected" {/if}>Membership Plan</option>
                  <option value="leadprice" {if $smarty.get.paymentfor eq 'leadprice'} selected="selected" {/if}>Lead Price</option>
                </select>
                &nbsp;&nbsp;
                <input type="text" name="from_date" id="from_date" class="input datepicker" value="{if $smarty.get.from_date}{$smarty.get.from_date}{else}From Date{/if}" onblur="if(this.value=='')this.value='From Date'" style="width:100px !important;" />
                &nbsp;&nbsp;
                <input type="text" name="to_date" id="to_date" class="input datepicker" value="{if $smarty.get.to_date}{$smarty.get.to_date}{else}To Date{/if}" onblur="if(this.value=='')this.value='To Date'" style="width:100px !important;" />
                &nbsp;&nbsp;
                <input type="hidden" name="user_id" id="user_id" value="{$userDetArray.id|base64_encode}"/>
                <input type="button" class="admin_btn" value="Search" onclick="searchOrder();">
                &nbsp;&nbsp;
                <input type="button" class="admin_btn" value="Clear" onclick="javascript:window.location='{$siteroot}/admin/home.php?q=paymenthisdetail&id={$userDetArray.id|base64_encode}'">
                 &nbsp;&nbsp;
                <input type="button" class="admin_btn" value="Export CSV" onclick="javascript:window.location='{$siteroot}/admin/home.php?q=paymenthisdetail&task=exportcsv&id={$userDetArray.id|base64_encode}'">
                 &nbsp;&nbsp;
                 
                 <a href="{$siteroot}/admin/home.php?q=paymenthistory" class="rF"><input type="button" class="admin_btn" value="Back"/></a> </td>
            </tr>
          </table>
          <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_viewbox">
            <tr>
              <th width="20%" class="col1">Payment For</th>
              <th width="10%" class="col1">Amount</th>
              <th width="20%" class="col1">Plan name</th>
              <th width="10%" class="col1">Invoice</th>
              <th width="10%" class="col1">Payment Method</th>
              <th width="10%" class="col1">Status</th>
              <th class="col1">Date</th>
            </tr>
            {section name=i loop=$historyArray}
            <tr class="inactiverow" >
              <td align="left">{if $historyArray[i].paymentfor eq 'membershipplan'} Membership Plan {/if}{if $historyArray[i].paymentfor eq 'leadprice'} Lead Price {/if}</td>
              <td align="left">${$historyArray[i].amount}</td>
              <td align="left">{if $historyArray[i].planname neq '-'} Membership: {$historyArray[i].planname} {$memcats} {else} Buy Lead {/if}</td>
              <td align="left">
              
              	<a href="{$siteroot}/maker/pdfmaker.php?uid={$historyArray[i].user_id}&invoiceid={$historyArray[i].id}">{$historyArray[i].invoiceid}</a>
              	<a href="{$siteroot}/maker/pdfmaker.php?uid={$historyArray[i].user_id}&invoiceid={$historyArray[i].id}" style="text-align:right; float:right;"><img src="../images/pdf.png" /></a>
              </td>
              <td align="left">{$historyArray[i].pmethod neq}</td>
              <td align="left">{if $historyArray[i].plan_id eq '1'}-{else} {$historyArray[i].status|ucfirst} {/if}</td>
              <td align="left">{$historyArray[i].status_date}</td>
            </tr>
            {sectionelse}
            <tr>
               <td colspan="7" align="center" style="padding:10px;text-align:center;" class="error">Oops, Sorry there are no Payment paid.</td>
              </tr>
            
            <!-- {$newid++} --> 
            {/section} 
            
            <tr>
              <td colspan="7"><div class="pagination"> {if $pagenation}
                            <section class="pagna">
                            {$pagenation}
                            </section>
                        {/if} </div></td>
            </tr>
          </table>
        </div>
        <!--Form Contain end--> 
      </div>
    </div>
  </div>
  <!--right_contain end-->
  <div class="clear"></div>
</div>
{include file=$footer}